#include "TimerFd.h"
#include <chrono>
#include <iostream>
#include <functional>
#include <thread>

using std::cout;
using std::endl;
using std::bind;
using std::thread;

class MyTask
{
public:
    void process()
    {
        cout << ">>MyTask is running!!!" << endl;
    }
};

int main(int argc, char *argv[])
{
    MyTask task;
    TimerFd tf(bind(&MyTask::process, &task), 1, 4);
    thread th(bind(&TimerFd::start, &tf));//th子线程

    std::this_thread::sleep_for(std::chrono::seconds(30));

    tf.stop();
    th.join();
    return 0;
}

